Skip to content

Create script.js#1

Open
albignos-web wants to merge 1 commit intoSamFold:mainfrom
albignos-web:patch-1
Open

Create script.js#1
albignos-web wants to merge 1 commit intoSamFold:mainfrom
albignos-web:patch-1

Conversation

@albignos-web
Copy link
Copy Markdown

function startGame() {
document.querySelector(".start-button").classList.add("hidden");
document.querySelector(".subtitle").classList.add("hidden");
document.getElementById("game-screen").classList.remove("hidden");

let score = 0;
const scoreDisplay = document.getElementById("score");

// Simula aumento punteggio
setInterval(() => {
score += Math.floor(Math.random() * 10);
scoreDisplay.textContent = score;
}, 1000);
}

document.querySelector(".start-button").addEventListener("click", startGame);

document.addEventListener("keydown", function(event) {
if (event.key === "Enter") {
startGame();
}
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant